PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Quit

Quit is an application command that terminates an application. If no optional parameters are specified, the Quit command has the same result as choosing the Quit menu item in the application.

SYNTAX
quit referenceToApplication [ saving saveOption ]
PARAMETERS
referenceToApplication
A reference of the form application nameString , where nameString is a string that matches the name of the application you want to quit as it is listed in the Application menu. Class. Reference
saveOption
A constant that specifies whether to save documents that have been modified before quitting. The possible values are yes , no , and ask . The value yes specifies to save the documents. The value no specifies not to save the documents. The value ask specifies to ask the user whether or not to save the documents. See "Notes" below for more information. Class: Constant Default Value: ask
RESULT

None

EXAMPLES

The first example below causes the application to quit without saving any modified documents. The second example asks before saving any modified documents.

tell application "AppleWorks"
    quit saving no
end tell


quit application "AppleWorks" saving ask

© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)